﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Chat.aspx.cs" Inherits="WebChat.Chat" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server" ID="AspScriptManager"></asp:ScriptManager>

        <asp:UpdatePanel ID="ChatLogUpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:TextBox ID="ChatLogBox" ReadOnly="true" TextMode="MultiLine" Width="500" Height="300" runat="server"> </asp:TextBox>
                <br />
                
                <asp:Timer ID="MessageTimer" runat="server" Interval="1000" OnTick="GetMessages"></asp:Timer>   
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="MessageTimer" EventName="Tick" />
            </Triggers>
        </asp:UpdatePanel>

        <asp:UpdatePanel ID="NewMsgUpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:TextBox ID="NewMessageBox" TextMode="SingleLine" runat="server" Width="450"></asp:TextBox>
                <asp:Button ID="SendMessageButton" Text="Send" runat="server" OnClick="SendMessage" Width="50"/>
            </ContentTemplate>
        </asp:UpdatePanel>

         
    </div>
    </form>
</body>
</html>
